package com.it.web;

import com.it.entity.closure.AiClaimClosure;
import com.it.service.AiClaimClosureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import utils.R;

/**
 * <p>
 *  理赔结案信息表（理赔全流程结束后的最终记录） 前端控制器
 * </p>
 *
 * @author lutao
 * @since 2025年09月24日
 */
@RestController
@RequestMapping("/aiClaimClosure")
public class AiClaimClosureController {

    @Autowired
    private AiClaimClosureService aiClaimClosureService;

    /**
     * 获取结案信息列表，分页
     */
    @GetMapping("/list")
    public R getAll(@RequestParam(value = "pageNum", defaultValue = "1",required = false) Integer pageNum,
                    @RequestParam(value = "pageSize", defaultValue = "10",required = false) Integer pageSize,
                    @RequestParam(value = "closureId", required = false) String closureId,
                    @RequestParam(value = "closureType", required = false) Integer closureType) {
        return aiClaimClosureService.list(pageNum, pageSize, closureId, closureType);
    }

    /**
     * 新增结案信息
     */
    @PostMapping
    public R add(@RequestBody AiClaimClosure aiClaimClosure) {

        return aiClaimClosureService.insert(aiClaimClosure);
    }

}
